<script src="__STATIC__/index/js/jquery.js"></script>
<script src="__STATIC__/index/js/layer/layer.js"></script>
<link rel="stylesheet" type="text/css" href="__STATIC__/index/css/style.css" />
<div style="width:150px;height:150px;padding:25px;">
    <input type="file" class="file" value=""></br></br>
    <input type="button" class="link_btn" onclick="submit()" value="确认">
</div>
<script>
    function submit(){
          var formData = new FormData();
          var file = $(".file").get(0).files[0];

          formData.append('file',file);
          var index = layer.load(2, {shade: false}); //0代表加载的风格，支持0-2
          $.ajax({
              url:"{:url('Sms/txt_add')}",
              type:'POST',
              data:formData,
              async:false,
              processData:false,
              contentType:false,
              success:function(result) {
                  var mobile = parent.$('#mobile').val();
                  if(result.code == '1'){
                    if(mobile != ""){
                      var result_msg_string = ","+result.msg;
                      mobile += result_msg_string;
                    }else{
                      mobile = result.msg;
                    }
                    parent.$('#mobile').val(mobile);
                    parent.repeat();
                    parent.clearErro();
                    layer.close(index);
                  }
              }
          });

          var index = parent.layer.getFrameIndex(window.name);
          parent.layer.close(index);
    }
</script>
</body>
</html>
